#include <stdio.h>
#include <stdlib.h>

int main(int argc, char const *argv[])
{
    int **m_a, **m_b;
    int row_a, col_a, row_b, col_b;
    int **result;
    scanf("%d", &row_a);

    scanf("%d", &col_a);

    scanf("%d", &row_b);

    scanf("%d", &col_b);
    if (col_a != row_b)
    {

        return 0;
    }
    m_a = (int **)malloc(row_a * sizeof(int *));
    for (int i = 0; i < row_a; i++)
    {
        m_a[i] = (int *)malloc(col_a * sizeof(int));
    }
    m_b = (int **)malloc(row_b * sizeof(int *));
    for (int i = 0; i < row_b; i++)
    {
        m_b[i] = (int *)malloc(col_b * sizeof(int));
    }

    for (int i = 0; i < row_a; i++)
    {
        for (int j = 0; j < col_a; j++)
        {
            scanf("%d", &(m_a[i][j]));
        }
    }

    for (int i = 0; i < row_b; i++)
    {
        for (int j = 0; j < col_b; j++)
        {
            scanf("%d", &(m_b[i][j]));
        }
    }

    result = (int **)malloc(row_a * sizeof(int *));
    for (int i = 0; i < row_a; i++)
    {
        result[i] = (int *)malloc(col_b * sizeof(int));
    }
    for (int i = 0; i < row_a; i++)
    {
        for (int j = 0; j < col_b; j++)
        {
            result[i][j] = 0;
            for (int k = 0; k < col_a; k++)
            {
                result[i][j] += (m_a[i][k] * m_b[k][j]);
            }
        }
    }
    for (int i = 0; i < row_a; i++)
    {
        for (int j = 0; j < col_b; j++)
        {
            printf("%d\t", result[i][j]);
        }
        printf("\n");
    }

    return 0;
}